import { createRouter, createWebHistory } from 'vue-router'
import homeView from '@/views/home/home.vue'
import indexView from '@/views/home/index.vue'
import catView from '@/views/home/cat.vue'
import fxView from '@/views/home/fx.vue'
import myView from '@/views/home/my.vue'
import searchView from '@/views/home/search.vue'
import cardView from '@/views/home/card.vue'
import goodsView from '@/views/home/goods.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    { path: '/', redirect: '/home/index' },
    { path: '/home', name: 'home', component: homeView,children:[
    { path: 'index', name: 'index', component: indexView, },
    { path: 'cat', name: 'cat', component: catView, },
    { path: 'fx', name: 'fx', component: fxView, },
    { path: 'card', name: 'card', component: cardView, },
    { path: 'my', name: 'my', component: myView, },
    { path: 'search', name: 'search', component: searchView, },
    { path: 'goods/:query', name: 'goods', component: goodsView, },

    ] },

  ],
})

export default router
